#-*- coding:utf8 -*-
import requests
import json
from reqwx import get_access_token, send_module_msg, get_module_id

a_Token = get_access_token()
url = "https://api.weixin.qq.com/cgi-bin/message/custom/send"

req_get_uid_url = "https://api.weixin.qq.com/cgi-bin/user/get"
para_get_uid_data = {"access_token":a_Token}
res_get_uid = req_get_uid = requests.get(req_get_uid_url, para_get_uid_data)
res_b = req_get_uid.content
res = json.loads(res_b)
openid = res["data"]["openid"][0]

ss = "你好"
txt_body = {"touser":openid,
		"msgtype":"text",
		"text":{
			"content":ss

}}

sys_name = "测试系统说明"
sys_info = "测试信息内容"
ss_body = {"sysname":{
	"value":sys_name,
	"color":"#FF3117"
	},
"sysinfo":{
	"value": sys_info,
	"color": "#173177"
}}

module_id = get_module_id(a_Token)
send_module_msg(a_Token,openid,module_id,ss_body)
